import React, { lazy } from "react";

const Login = React.lazy(() => import('../pages/login'))

const Detail = React.lazy(() => import('../pages/detail'))

const Home = React.lazy(() => import('../pages/home'))
const Shouye = React.lazy(() => import('../pages/home/shouye'))
const My = React.lazy(() => import('../pages/home/my'))
const Room = React.lazy(() => import('../pages/home/room'))
const Issue = React.lazy(() => import('../pages/home/issue'))
const Information = React.lazy(() => import('../pages/home/information'))

export const MenuList = [{
    path: "/home/shouye",
    name: "首页",
    element: <Shouye></Shouye>,
},{
    path: "/home/my",
    name: "我的",
    element: <My></My>,
},{
    path: "/home/room",
    name: "找房",
    element: <Room></Room>,
},
{
    path: "/home/issue",
    name: "发布",
    element: <Issue></Issue>,
},{
    path: "/home/information",
    name: "消息",
    element: <Information></Information>,
},]



const changeRoutes = (routes = MenuList) => {
    return [
        {
            path: "/home",
            name: "主页",
            element: <Home></Home>,
            children: routes,
        },
        {
            path: "/login",
            name: "登录",
            element: <Login />,
        },
        {
            path: "/detail/:id",
            element: <Detail />,
        },
    ];
  };
  
  export default changeRoutes;


